1. Field of the Invention
The present invention relates to a data storage device, and in particular to a method for managing flash memory.
2. Description of the Related Art
Flash memory is considered a non-volatile data-storage device, using electrical methods to erase and program itself. Taking NAND Flash as an example, it is often used in memory cards, USB flash devices, solid state devices, eMMC and other uses. The manufacturing cost of the flash memory is lower than the electrically erasable programmable read-only memory (EEPROM), such that flash memory has become the main product on the market. Furthermore, flash memory can be applied to handheld computers (PDA), notebook computers, digital music players, digital cameras, and mobile phones, etc.
Flash memory includes a plurality of blocks. Each of the blocks includes a plurality of pages for storing data. Data in the flash memory is erased in units of one block, and data in the flash memory is programmed by units of one page. Namely, when data in the flash memory is required to be erased, all of the data stored in the pages of a block will be erased. The data of the flash memory can be written into the pages. When a part of pages of a block needs to be updated, the new data cannot be written into the part of the pages, because the pages are occupied by the old data.